package com.zhuangjie.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhuangjie.mvc.helper.GeoHelper.GeoCoordinates;
import com.zhuangjie.shop.dto.FollowShopPageDTO;
import com.zhuangjie.shop.dto.SearchNearbyStoresPageDTO;
import com.zhuangjie.shop.entity.Shop;
import com.zhuangjie.shop.pojo.ShopAdvanceBookingDays;
import com.zhuangjie.shop.vo.*;
import com.zhuangjie.shop.vo.shop_display.NearbyShopVO;
import com.zhuangjie.shop.vo.shop_display.ShopStatisticalForShopShowFromDB;
import com.zhuangjie.shop.vo.shop_display.ShopSurfaceInfoVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 商家/商店 Mapper 接口
 * </p>
 *
 * @author zhuangjie
 * @since 2023-09-24
 */
public interface ShopMapper extends BaseMapper<Shop> {


    Page<NearbyShopVO> searchNearbyStoresBaseInfo(@Param("page") Page<NearbyShopVO> page, @Param("param") SearchNearbyStoresPageDTO searchNearbyStoresPageDTO);

    ShopPredetermineInfo selectShopBusinessInfo(@Param("shopId") Long shopId);

    ShopToUserDeliveryInfo selectShopDeliveryInfoByUserGeoCoordinates(@Param("shopId") Long shopId, @Param("geoCoordinates") GeoCoordinates geoCoordinates);

    CreateOrderShopBasicInfo getCreateOrderBasicInfo(@Param("shopId") Long shopId);

    String getShopPhone(@Param("shopId") Long shopId);

    List<ShopAdvanceBookingDays> selectAdvanceBookingDaysByShopIds(@Param("shopIds") List<Long> shopIds);

    ShopForRider getShopAddress(@Param("shopId") Long shopId);

    ShopBusinessConfigVO queryBusinessConfig(@Param("shopId") Long shopId);

    List<ShopDisplayInfo> queryShopsDisplayInfoByIds(@Param("shopIds") List<Long> shopIds);

    Short queryShopDeliveryMethod(@Param("shopId") Long shopId);

    ShopForUserOrderMapVO selectShopInfoForUserOrderMap(@Param("shopId") Long shopId);

    List<ShopStatisticalForShopShowFromDB> queryShopStatisticalForShopShow(@Param("shopIds") Set<Long> shopIds);

    Page<ShopSurfaceInfoVO> followShopPage(@Param("page") Page<ShopSurfaceInfoVO> page, @Param("param") FollowShopPageDTO pageDTO, @Param("userId") Long userId);

}
